package acn.spring.backend.spring;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

import acn.spring.domain.Item;

public class ItemRowMapper implements ParameterizedRowMapper<Item> {

	public Item mapRow(ResultSet rs, int arg0) throws SQLException {
		Item i = new Item();
		
		i.setId(rs.getInt("id"));
		i.setName(rs.getString("name"));
		i.setPrice(rs.getLong("price"));
		
		return i;
	}

}
